import java.util.*;
import java.io.*;

public class test {
    public static PrintWriter pr = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
    public static Read in = new Read();
    //蓝桥杯 对联(⭐⭐)
    public static void main(String[] args) throws IOException{
        int n = in.nextInt();
        int sum01 = 0;int sum00 = 0;
        int sum11 = 0;int sum10 = 0;
        String s1 = in.next();
        String s2 = in.next();
        for(int i = 0;i < s1.length();i++) {
            if (s1.charAt(i) == '0') {
                sum00++;
            }else {
                sum01++;
            }
        }
        for(int i = 0;i < s2.length();i++) {
            if (s2.charAt(i) == '0') {
                sum10++;
            }else {
                sum11++;
            }
        }
        System.out.println(Math.min(sum00, sum11) + Math.min(sum01, sum10));
    }
    //蓝桥杯 电子舞龙(⭐⭐)
    public static void main() throws IOException{
        String s = in.next();
        if(s.length() % 2 != 0) {
            System.out.println(-1);
            return;
        }
        //[0]L [1]R [2]U [3]D
        // LLL RRRRR UU DDD
        int[] arr = new int[4];
        for(int i = 0;i < s.length();i++) {
            char c = s.charAt(i);
            switch(c) {
                case 'L':arr[0]++;break;
                case 'R':arr[1]++;break;
                case 'U':arr[2]++;break;
                case 'D':arr[3]++;break;
            }
        }
        // L:2  R:0  U:2  D:0
        int lr = Math.abs(arr[0] - arr[1]);
        int ud = Math.abs(arr[2] - arr[3]);
        System.out.println((lr + ud) / 2);
    }
    //蓝桥杯 神秘符文的重复序列(⭐⭐⭐)
    public static void main(String[] args) throws IOException{
        int n = in.nextInt();
        int k = in.nextInt();
        int a = 0;
        long b = 0;
        String s = in.next();
        for(int i = 0;i < n;i++) {
            if(s.charAt(i) == 'b') {
                b++;
            }
        }
        long sum1 = 0;
        long newb = b;
        for(int i = 0;i < n;i++) {
            if(s.charAt(i) == 'a') {
                sum1 += k * newb + (k - 1) * ((k - 1) * b + b) / 2;
            }
            if(s.charAt(i) == 'b') {
                newb--;
            }
        }
        System.out.println(sum1);
        //abcb abcb
        //n*(a1 + an) / 2          k * (8 + 2) / 2 = 20
        //abcb abcb abcb abcb abcb 8 + 6 + 4 + 2 = 20
        //
    }
    //蓝桥杯 伦太郎的胡椒博士汽水(⭐⭐⭐)
    public static void main1() throws IOException{
        //数组大小
        int n = in.nextInt();
        //最大值与最小值的最大差值
        int k = in.nextInt();
        //存储窗口内的最大值[的下标!]
        Deque<Integer> bigqueue = new ArrayDeque<>();
        //存储窗口内的最小值[的下标!]
        Deque<Integer> queue = new ArrayDeque<>();
        int[] arr = new int[n];
        for(int i = 0;i < n;i++) {
            arr[i] = in.nextInt();
        }
        int left = 0;
        long sum = 0;
        //     3 14 5 8 9 6
        //big: 3 -> 14 -> 5-> 8   -> 9   -> 6
        //sma: 3 -> 14 -> 5-> 5 8 -> 8 9 -> 6
        for(int right = 0;right < n;right++) {
            //维护最大值队列
            //1.如果arr当前的数字大于peekLast值,则删除peeklast
            while(!bigqueue.isEmpty() && arr[right] >= arr[bigqueue.peekLast()]) {
                bigqueue.removeLast();
            }
            //2.如果进入上述循环,则代表比最大值还大,删空queue,加入right
            //3.如果不进入上述循环,则代表没有最大值大,扔到后面
            bigqueue.addLast(right);
            //维护最小值队列
            //同上
            while(!queue.isEmpty() && arr[right] <= arr[queue.peekLast()]) {
                queue.removeLast();
            }
            queue.addLast(right);
            while(arr[bigqueue.peekFirst()] - arr[queue.peekFirst()] > k) {
                if(bigqueue.peekFirst() == left) {
                    bigqueue.removeFirst();
                }
                if(queue.peekFirst() == left) {
                    queue.removeFirst();
                }
                left++;
            }
            sum += right - left;
        }
        System.out.println(sum);
    }
}
class Read{
    StringTokenizer st = new StringTokenizer("");
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String next() throws IOException{
        while(!st.hasMoreTokens()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }
    int nextInt() throws IOException{
        return Integer.parseInt(next());
    }
    long nextLong() throws IOException{
        return Long.parseLong(next());
    }
    double nextDouble() throws IOException{
        return Double.parseDouble(next());
    }
}